<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>叩丁狼</title>
    <%@include file="../common/header.jsp"%>

    <%--<script>
        /*发送加载请求*/
        $(function () {
           $('.btn-success').click(function () {
             $.post('/permission/load',function (data) {
                 console.log(data.msg);
             });
           });
        });
    </script>--%>
</head>
<body>

<div class="container " style="margin-top: 20px">
    <%@include file="../common/top.jsp"%>
    <div class="row">
        <div class="col-sm-3">
            <%@include file="../common/menu.jsp"%>
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">权限管理</h1>
                </div>
            </div>
           <%-- <!--高级查询--->
            <form class="form-inline" id="searchForm" action="/employee/list" method="post">
                &lt;%&ndash;<input type="hidden" name="currentPage" id="currentPage">&ndash;%&gt;
                <div class="form-group">
                    <label for="keyword">关键字:</label>
                    <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword}" placeholder="请输入姓名/邮箱">
                </div>
                <div class="form-group">
                    <label for="dept">部门:</label>
                    <select class="form-control" id="dept" name="deptId">
                        <option value="-1">全部</option>
                        <c:forEach var="d" items="${depts}">
                            <option value="${d.id}">${d.name}</option>
                        </c:forEach>
                    </select>
                    <script>
                        $("#dept option[value='${qo.deptId}']").prop("selected", true);
                    </script>
                </div>
                <input type="submit" id="btn_query" class="btn btn-default" value="查询">
                <a href="/employee/input" class="btn btn-success">添加</a>
            </form>--%>
            <input type="submit" id="btn_query" class="btn btn-default" value="查询">
            <a href="/permission/load" class="btn btn-success">加载</a>
            <table class="table table-striped table-hover" >
                <thead>
                    <tr>
                        <th>编号</th>

                        <th>角色</th>
                        <th>表达式</th>
                        <th>操作</th>
                    </tr>
                </thead>
               <c:forEach items="${pageResult.data}" var="entity" varStatus="vs">
                   <tr>
                       <td>${vs.count}</td>
                       <td>${entity.name}</td>
                       <td>${entity.expression}</td>

                      <%-- <td>${entity.dept.name}</td>--%>
                       <td>
                           <a class="btn btn-info btn-xs" href="/permission/edit?id=${entity.id}">
                               <span class="glyphicon glyphicon-pencil"></span>编辑
                           </a>
                           <a href="/permission/delete?id=${entity.id}" class="btn btn-danger btn-xs" >
                               <span class="glyphicon glyphicon-trash"></span>删除
                           </a>
                       </td>
                   </tr>
               </c:forEach>
            </table>
            <div style="text-align: center;">
                <ul id="pagination" class="pagination"></ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>